<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Open an alert</title>
</head>
<body>

<p>
    <a href="#" onclick="alert('This is alert'); return false;" id="open-alert">Open alert</a>
    <br>

    <a href="#" onclick="setTimeout(function(){ alert('This is alert');}, 1000); return false;" id="open-alert-delayed">
        Open alert after 1 second
    </a>
    <br>

    <a href="#" onclick="openConfirm(); return false;" id="open-confirm">Open confirm</a>
    <br>

    <a href="#" onclick="openPrompt(); return false;" id="open-prompt">Open prompt</a>
    <br>
</p>

<div id="result"></div>

<script>
    function openConfirm() {
        document.getElementById("result").innerHTML = (confirm("Do you confirm?") ? 'accepted' : 'dismissed');

        return false;
    }

    function openPrompt() {
        document.getElementById("result").innerHTML = prompt("Enter prompt value");
    }
</script>

</body>
</html>
